using MESData.ErrorCode;
using MESData.ProductionPlan.API.DTO;

namespace MESData.ProductionPlan.API.Services
{
    /// <summary>
    /// 项目服务接口
    /// </summary>
    public interface IProjectService
    {
        /// <summary>
        /// 获取所有项目（用于下拉框选择）
        /// </summary>
        /// <param name="queryDto">查询参数</param>
        /// <returns></returns>
        Task<ApiResult<List<ProjectSelectDto>>> GetAllProjectsAsync(ProjectQueryDto? queryDto = null);

        /// <summary>
        /// 分页查询项目
        /// </summary>
        /// <param name="queryDto">查询参数</param>
        /// <returns></returns>
        Task<ApiResult<List<ProjectDto>>> GetProjectsPageAsync(ProjectQueryDto queryDto);

        /// <summary>
        /// 根据ID获取项目详情
        /// </summary>
        /// <param name="id">项目ID</param>
        /// <returns></returns>
        Task<ApiResult<ProjectDto>> GetProjectByIdAsync(int id);

        /// <summary>
        /// 新增项目
        /// </summary>
        /// <param name="dto">项目DTO</param>
        /// <param name="operatorName">操作人</param>
        /// <returns></returns>
        Task<ApiResult<bool>> CreateProjectAsync(ProjectDto dto, string operatorName);

        /// <summary>
        /// 更新项目
        /// </summary>
        /// <param name="id">项目ID</param>
        /// <param name="dto">项目DTO</param>
        /// <param name="operatorName">操作人</param>
        /// <returns></returns>
        Task<ApiResult<bool>> UpdateProjectAsync(int id, ProjectDto dto, string operatorName);

        /// <summary>
        /// 删除项目
        /// </summary>
        /// <param name="id">项目ID</param>
        /// <param name="operatorName">操作人</param>
        /// <returns></returns>
        Task<ApiResult<bool>> DeleteProjectAsync(int id, string operatorName);
    }
} 